package com.aspose.cells;

class zbua extends zf {
   private int b;
   private zbua.za c;
   private int d;

   zbua(int var1, Row var2) {
      super(var2);
      this.b = var1;
      this.d = -1;
   }

   public int b() {
      return this.d;
   }

   public void c(int var1) {
      this.d = var1;
   }

   public void a() {
      this.c = null;
   }

   public Cell a(int var1) {
      if (this.c == null) {
         this.c = new zbua.za();
         this.c.b = new Cell(this.a, var1);
         return this.c.b;
      } else {
         int var2 = this.a.a.a(var1);
         if (this.c.b.getColumn() == var2) {
            this.c.b.a = var1;
            this.c.b.c = this.a.a.a(var1, this.c.b.c, 7);
            return this.c.b;
         } else {
            zbua.za var3 = this.c;
            zbua.za var4 = this.c.a;

            for(int var5 = 2; var4 != null; ++var5) {
               if (var4.b.getColumn() == var2) {
                  var3.a = var4.a;
                  var4.a = this.c;
                  this.c = var4;
                  this.c.b.a = var1;
                  this.c.b.c = this.a.a.a(var1, this.c.b.c, 7);
                  return this.c.b;
               }

               if (var5 >= this.b) {
                  var3.a = null;
                  var4.b = new Cell(this.a, var1);
                  var4.a = this.c;
                  this.c = var4;
                  return this.c.b;
               }

               var3 = var4;
               var4 = var4.a;
            }

            var4 = new zbua.za();
            var4.b = new Cell(this.a, var1);
            var4.a = this.c;
            this.c = var4;
            return this.c.b;
         }
      }
   }

   public Cell b(int var1) {
      if (this.c == null) {
         return null;
      } else if (this.c.b.getColumn() == var1) {
         return this.c.b;
      } else {
         zbua.za var2 = this.c;

         for(zbua.za var3 = this.c.a; var3 != null; var3 = var3.a) {
            if (var3.b.getColumn() == var1) {
               var2.a = var3.a;
               var3.a = this.c;
               this.c = var3;
               return this.c.b;
            }

            var2 = var3;
         }

         return null;
      }
   }

   public Cell a(int var1, boolean var2, boolean var3) {
      if (this.c == null) {
         Cell var8 = this.b(var1, var2, var3);
         if (var8 == null) {
            return null;
         } else {
            this.c = new zbua.za();
            this.c.b = var8;
            return this.c.b;
         }
      } else if (this.c.b.getColumn() == var1) {
         if (this.a(this.c.b, var1, var2, var3)) {
            return this.c.b;
         } else {
            this.c = this.c.a;
            return null;
         }
      } else {
         zbua.za var4 = this.c;
         zbua.za var5 = this.c.a;

         Cell var7;
         for(int var6 = 2; var5 != null; ++var6) {
            if (var5.b.getColumn() == var1) {
               if (this.a(var5.b, var1, var2, var3)) {
                  var4.a = var5.a;
                  var5.a = this.c;
                  this.c = var5;
                  return this.c.b;
               }

               var4.a = var5.a;
               return null;
            }

            if (var6 >= this.b) {
               var7 = this.b(var1, var2, var3);
               if (var7 == null) {
                  return null;
               }

               var4.a = null;
               var5.b = var7;
               var5.a = this.c;
               this.c = var5;
               return var7;
            }

            var4 = var5;
            var5 = var5.a;
         }

         var7 = this.b(var1, var2, var3);
         if (var7 == null) {
            return null;
         } else {
            var5 = new zbua.za();
            var5.a = this.c;
            var5.b = var7;
            this.c = var5;
            return var7;
         }
      }
   }

   private class za {
      zbua.za a;
      Cell b;

      private za() {
      }

      // $FF: synthetic method
      za(Object var2) {
         this();
      }
   }
}
